package com.youme.tools.cg.db.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesReader extends Properties {
  static final long serialVersionUID = 1L;
  private static PropertiesReader instance = null;

  private PropertiesReader() {
    InputStream is = getClass().getResourceAsStream("/db.properties");
    try {
      this.load(is);
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

  public static PropertiesReader getInstance() {
    if (null == instance) {
      makeInstance();
    }
    return instance;
  }

  private static synchronized void makeInstance() {
    if (instance == null) {
      instance = new PropertiesReader();
    }
  }

}
